package com.android.camera.one.v2.camera2proxy;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.android.camera.one.v2.camera2proxy.ImageWriterProxy.OnImageReleasedListener;

import android.media.Image;
import android.media.ImageWriter;
import android.os.Handler;

public abstract class ForwardingImageWriter implements ImageWriterProxy {
	private final ImageWriterProxy mDelegate;

    public ForwardingImageWriter(ImageWriterProxy delegate) {
        mDelegate = delegate;
    }
    
	@Override
	public int getMaxImages() {
        return mDelegate.getMaxImages();
	}

	@Override
	public int getFormat() {
        return mDelegate.getFormat();
	}

	@Override
	public ImageProxy dequeueInputImage() {
		return mDelegate.dequeueInputImage();
	}

	@Override
	public void queueInputImage(ImageProxy image) {
		mDelegate.queueInputImage(image);
	}
	
	public void setOnImageReleasedListener(
			final @Nonnull OnImageReleasedListener listener, 
    		@Nullable Handler handler) {
		mDelegate.setOnImageReleasedListener(listener, handler);
	}

	@Override
    public void close() {
        mDelegate.close();
    }
	
	@Override
	public boolean isClosed() {
		return mDelegate.isClosed();
	}

    @Override
    public String toString() {
        return mDelegate.toString();
    }
}
